<!-- 略缩图 -->
<template>
  <div style="display: inline-block;
     margin-left: 10px;text-align: center;margin-top: 10px;">
    <a href="javascript:void(0)" @click="handleClick" itemprop="contentUrl" style="color: white">
      <img :src="imgsrc" :width="mw" :height="mh" />
      <br>{{title}}
    </a>
  </div>
</template>

<style>
</style>

<script>
export default {
  name: 'thumbnail',
  data () {
    return {}
  },
  mounted () {},
  methods: {
    handleClick () {
      // 触发点击图片事件
      this.$emit('clickImg', { src: this.imgsrc, addition: this.addition })
    }
  },
  props: {
    // 图片源
    'imgsrc': {
      type: String,
      default: '',
      required: true
    },
    // 标题
    'title': {
      type: String,
      default: ''
    },
    // 缩略图宽
    'mw': {
      type: Number,
      default: 100
    },
    // 缩略图高
    'mh': {
      type: Number,
      default: 100
    },
    // 附加
    'addition': { }
  }
}
</script>
